const { log } = require("console");
const http = require("http");

const app = http.createServer((req, res) => {
    const table = `
    <html>
        <header>
            <title>form body</title>
        </header>
        <body>
            <form action="http://localhost:4000" method="post">
                <input type="text" name="usename">
                <input type="text" name="password">
                <input type="submit" value="提交">
            </form>
        </body>
    </html>
    `
    res.setHeader("content-type", "text/html;charset=utf-8")
    res.end(table)
})

app.listen(4000, () => {
    log(`服务4000已经启动！运行中...`)
})